package com.woniu.user.controller;


import com.woniu.entity.Result;
import com.woniu.user.service.IUserLikeCarService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户关注车辆表 前端控制器
 * </p>
 *
 * @author LiFangyu
 * @since 2023-02-15
 */
@RestController
@RequestMapping("/user-like-car")
public class UserLikeCarController {
    @Autowired
    private IUserLikeCarService likeCarService;

    @ApiOperation("关注车辆")
    @GetMapping("/addLikeCar/{userPhone}/{carId}")
    public Result addLikeCar(@PathVariable("userPhone") String userPhone, @PathVariable("carId") String carId){
        return likeCarService.addLikeCar(userPhone,carId);
    }

    @ApiOperation("取消关注车辆")
    @GetMapping("/rmLikeCar/{userPhone}/{carId}")
    public Result rmLikeCar(@PathVariable("userPhone") String userPhone, @PathVariable("carId") String carId){
        return likeCarService.rmLikeCar(userPhone,carId);
    }

}
